package org.romzzz.gwtclassifieds.client;

import org.romzzz.gwtclassifieds.client.service.ClassifiedService;
import org.romzzz.gwtclassifieds.client.ui.ClassifiedScreen;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * Entry point class for the GWTClassifieds application.
 */
public class GWTClassifieds implements EntryPoint {
	
	public void onModuleLoad() {
		ClassifiedService.App.getInstance().enableAdminMode(new AsyncCallback<Boolean>() {
			public void onFailure(Throwable caught) {
				RootPanel.get().add(new ClassifiedScreen(false));
			}

			public void onSuccess(Boolean result) {
				RootPanel.get().add(new ClassifiedScreen(result.booleanValue()));
			}
		});
	}

}
